{% extends 'GessehCoreBundle::layout.html.twig' %}

{% block titlecontent %}Évaluations du stage '{{ department.name }} à {{ department.hospital.name }}'{% endblock %}

{% block actionscontent %}
  <ul>
    <li><a href="{{ path('GCore_FSIndex') }}" title="Retour à la liste des terrains">Retour</a></li>
    <li><a href="{{ path('GCore_FSShowDepartment', {id: department.id}) }}" title="Afficher les informations concernant le service">Informations</a></li>
  </ul>
{% endblock %}

{% block content %}
  <h2>Évaluations numériques</h2>
  <table>
    <thead>
      <tr>
        <th>Critère</th>
        <th class="small">Moyenne</th>
        <th class="small">Évaluations</th>
      </tr>
    </thead>
    <tbody>
      {% for criteria in eval_num %}
        <tr>
          <td>{{ criteria['name'] }}</td>
          <td class="small">{{ criteria['mean'] }}</td>
          <td class="small">{{ criteria['count'] }}</td>
        </tr>
      {% else %}
        <tr>
          <td colspan=2>Aucune évaluation numérique.</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
  <h2>Évaluations textuelles</h2>
  {% set crit = null %}
  {% for text in eval_text %}
    {% if crit != text.evalCriteria.id %}
      {% if crit %}</div>{% endif %}
      {% set crit = text.evalCriteria.id %}
      <div class="criteria_block">
        <div class="criteria_name">{{ text.evalCriteria.name }}</div>
      {% endif %}
        <div class="criteria_content">
          <span class="eval_title">{{ text.createdAt|date('d-m-Y') }} :</span>
          <span class="eval_content">{{ text.value }}</span>
        </div>
  {% else %}
    <div class="criteria_block">Aucun commentaire.
  {% endfor %}
    </div>
{% endblock %}
